package com.dews.common.constant;

import lombok.Data;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * @author qingfeng
 * @version 1.0.0
 * @date 2023/10/12
 */
@Data
@Component
@ConfigurationProperties(prefix="oss.ram")
public class OssRamPropertiesConstant implements InitializingBean {

    private String endpoint;
    private String accessKeyId;
    private String secret;
    private String bucket;

    public static String ENDPOINT;
    public static String ACCESS_KEY_ID;
    public static String SECRET;
    public static String BUCKET;

    /**
     * 设置属性后
     *
     * @throws Exception 异常
     */
    @Override
    public void afterPropertiesSet() throws Exception {
        ENDPOINT = endpoint;
        ACCESS_KEY_ID = accessKeyId;
        SECRET = secret;
        BUCKET = bucket;
    }
}
